let util = require('util');
let mysqlPool = require('./MySQLPool');

class WinLostRecordDao {
    constructor(){}

    async save(uid, name, leftCoin, changeCoin, gameType, roomID, gameTime){
        let sql = 'insert into win_lost_record (uid, name, leftCoin, changeCoin, gameType, utime, roomId, gameTime)' +
        '                                  values (?,   ?,    ?,        ?,          ?,        now(), ?,      ?)';

        let args = [uid, name, leftCoin, changeCoin, gameType, roomID, gameTime];
        let res = await mysqlPool.query(sql, args);
        if (res){
            return res;
        }
    }
}

let winLostRecordDao = new WinLostRecordDao();
module.exports = winLostRecordDao;